<?php

App::uses('AppModel', 'Model');

class Client extends AppModel {
	
	public $validate = array(
		'name' => array(
			'rule' => 'notEmpty',
			'allowEmpty' => false,
			'message' => 'Morate uneti naziv klijenta'
		)
	);
	
	public $hasMany = array(
		'ClientRebate' => array(
			'dependent'	=> true,
			'order'		=> 'ClientRebate.effective_date DESC, ClientRebate.id DESC'
		),
        'ClientPayingCurrency' => array(
            'dependent' => true,
            'order'     => 'ClientPayingCurrency.effective_date DESC, ClientPayingCurrency.id DESC'
        ),
		'ProductClients'
	);
}

?>